Kernel Density Estimation: Kernel Density Estimation (KDE)
Description
Kernel density estimation of a univariate sample using a Gaussian kernel.
Usage
kde(y, h, ncores = 1)
Value
A numeric vector of density estimates corresponding to each observation in y.
Arguments
y
A numeric vector containing the sample data.
h
A numeric value for boundwidth.
ncores
The number of cores to use. If greater than 1, parallel computing will take
place. It is advisable to use it if you have many observations and or many
variables, otherwise it will slow down the process. The default is 1, meaning
that code is executed serially.
The kernel density estimate (KDE) provides a smooth estimate of the probability
density function of the sample data. In this implementation, the KDE is
evaluated only at the observed sample points themselves.